<!-- 学生管理 -->
<template>
  <div class="page-box h100 display-flex czbj">
    <p class="title-label mb10" v-if="!props.xxid">学生管理</p>
    <dxtable
      :dataJson="dataJson"
      :portUrl="portUrl"
      :formJson="formJson"
      :qx="qx"
      ref="databale"
      :isshowSc="!props.xxid"
      :hidebj="props.xxid"
      :isshowXz="false"
    ></dxtable>
  </div>
</template>
<script lang="ts" setup>
import dxtable from "../../../components/util/dxtable.vue";
import sort from "../../../components/util/sort.vue";
import { dxget, dxpost } from "../../../util/index";
import { NButton, NImage, NTag } from "naive-ui";
import { h, ref, reactive } from "vue";
const fdfdsgta = ref([]);
const databale = ref();
let props = defineProps({
  xxid: "",
});

const initeer = () => {
  databale.value.initDataExpose();
};
let dataJson = [
  {
    title: "学生姓名",
    key: "xname",
    width: "",
    search: true,
  },
  {
    title: "性别",
    key: "sex",
    type: "select",
    options: [
      {
        label: "全部",
        value: "",
      },
      {
        label: "男",
        value: "男",
      },
      {
        label: "女",
        value: "女",
      },
    ],
    width: "",
    search: true,
  },
  {
    title: "手机号",
    key: "xphone",
    width: "",
    search: true,
  },
  {
    title: "年级",
    key: "nid",
    type: "select",
    search: true,
    options: [],
    render(row) {
      return row.njtext;
    },
  },
  {
    title: "班级",
    key: "banjiname",
  },
  {
    title: "班主任",
    key: "banzhurenname",
  },
  {
    title: "创建时间",
    key: "addTime",
  },
];

const qx = {
  DeletePermissionID: "123456", //删除
  EditPermissionIdentifier: "cjsglbj", // 编辑
  NewPermissionIdentifier: "", // 新建
  ViewPermissionID: "cjsglck", // 查看
};
let xxid = localStorage.xxid;
if (props.xxid) {
  xxid = props.xxid;
}
let portUrl = "courseManagement/xuesheng/xuesheng?xid=" + xxid;

let formJson = reactive([
  {
    title: "学生姓名",
    key: "xname",
    width: "",
    type: "input",
    search: true,
  },
  {
    title: "性别",
    key: "sex",
    type: "select",
    options: [
      {
        label: "全部",
        value: "",
      },
      {
        label: "男",
        value: "男",
      },
      {
        label: "女",
        value: "女",
      },
    ],
    width: "",
    search: true,
  },
  {
    title: "手机号",
    key: "xphone",
    width: "",
    type: "input",
    search: true,
  },
  {
    title: "年级",
    key: "nid",
    type: "select",
    search: true,
    options: [],
    render(row) {
      return row.njtext;
    },
  },
]);
const czFun = {
  fun: (row) => {
    return [
      h(
        NButton,
        {
          type: "info",
          quaternary: true,
          onClick: async (e) => {},
        },
        "复制代码"
      ),
    ];
  },
};

// 获取字典内容
const xtgxxmfl = async () => {
  const { data }: any = await dxget("dxgjAdmin/getzd/getzdJsList?ids=316,343");
  fdfdsgta.value = data[0];
  dataJson[3].options = [
    {
      label: "全部",
      value: "",
    },
    ...data[0],
  ];
  formJson[3].options = data[0];
};

xtgxxmfl();
</script>
<style scoped></style>

